#include "Pokemon.h"

Pokemon::Pokemon()
{
}

Pokemon::Pokemon(const QString &ident = "0")
{
	this->id = ident;
	this->ptrmap["name"] = &Pokemon::setName;
	this->ptrmap["type"] = &Pokemon::setType;
	this->ptrmap["id"] = &Pokemon::setId;
	this->ptrmap["ability"] = &Pokemon::setAbility;
	this->ptrmap["exp"] = &Pokemon::setExp;
	this->ptrmap["egg-group"] = &Pokemon::setEgg_group;
	this->ptrmap["species"] = &Pokemon::setSpecies;
	this->ptrmap["height"] = &Pokemon::setHeight;
	this->ptrmap["weight"] = &Pokemon::setWeight;
	this->ptrmap["description"] = &Pokemon::setDescription;
	this->ptrmap["egg"] = &Pokemon::setEgg;
}

Pokemon::~Pokemon()
{

}

void Pokemon::setCar(const QString &node, const QString &content)
{
	std::map<QString, f>::iterator itl = this->ptrmap.begin();
	std::map<QString, f>::iterator itle = this->ptrmap.end();

	for (; itl != itle; ++itl)
		if ((*itl).first == node)
			(this->*((*itl).second))(content);
}

QString								Pokemon::getId() const
{
	return (this->id);
}

QString						Pokemon::getName() const
{
	return (this->name);
}

std::list<QString>			Pokemon::getType() const
{
	return (this->type);
}

QString						Pokemon::getAbility() const
{
	return (this->ability);
}

QString								Pokemon::getExp() const
{
	return (this->exp);
}

std::map<QString, QString>		Pokemon::getStats() const
{
	return (this->stats);
}

std::map<QString, std::pair<QString, QString> >				Pokemon::getEvolution() const
{
	return (this->evolution);
}

std::map<QString, QString>	Pokemon::getRatio() const
{
	return (this->ratio);
}

std::list<QString>			Pokemon::getEgg_group() const
{
	return (this->egg_group);
}

QString						Pokemon::getSpecies() const
{
	return (this->species);
}

QString							Pokemon::getHeight() const
{
	return (this->height);
}

QString							Pokemon::getWeight() const
{
	return (this->weight);
}

QString						Pokemon::getDescription() const
{
	return (this->description);
}

std::map<QString, QString>		Pokemon::getLvlup() const
{
	return (this->lvlup);
}

std::map<QString, QString>		Pokemon::getTM() const
{
	return (this->TM);
}

std::map<QString, QString>		Pokemon::getHM() const
{
	return (this->HM);
}

std::list<QString>			Pokemon::getEgg() const
{
	return (this->egg);
}

void	Pokemon::setId(const QString id)
{
	this->id = id;
}

void	Pokemon::setName(const QString name)
{
	this->name = name;
}

void	Pokemon::setType(const QString type)
{
	this->type.push_back(type);
}

void	Pokemon::setAbility(const QString ability)
{
	this->ability = ability;
}

void	Pokemon::setExp(const QString exp)
{
	this->exp = exp;
}

void	Pokemon::setStats(const QString stat, const QString val)
{
	this->stats[stat] = val;
}

void	Pokemon::setEvolution(const QString id, std::pair<QString, QString> pair)
{
	this->evolution[id] = pair;
}

void	Pokemon::setRatio(const QString sexe, const QString rat)
{
	this->ratio[sexe] = rat;
}

void	Pokemon::setEgg_group(const QString group)
{
	this->egg_group.push_back(group);
}

void	Pokemon::setSpecies(const QString species)
{
	this->species = species;
}

void	Pokemon::setHeight(const QString height)
{
	this->height = height;
}

void	Pokemon::setWeight(const QString weight)
{
	this->weight = weight;
}

void	Pokemon::setDescription(const QString desc)
{
	this->description = desc;
}

void	Pokemon::setLvlup(const QString move, const QString lvl)
{
	this->lvlup[move] = lvl;
}

void	Pokemon::setTM(const QString move, const QString lvl)
{
	this->TM[move] = lvl;
}

void	Pokemon::setHM(const QString move, const QString lvl)
{
	this->HM[move] = lvl;
}

void	Pokemon::setEgg(const QString move)
{
	this->egg.push_back(move);
}